package com.guochenglang.www.dao.impl;

import com.guochenglang.www.dao.ReplyMessageDao;
import com.guochenglang.www.pojo.ReplyMessage;
import com.guochenglang.www.util.GetTable;
import com.guochenglang.www.util.connect.JdbcUtil;

import java.sql.SQLException;
import java.util.ArrayList;

/**
 * 回复消息提醒表的Dao层
 *
 * @author GuoChenglang
 */
public class ReplyMessageDaoImpl implements ReplyMessageDao {
    /**
     * 表名
     */
    private static final String TABLE = GetTable.getTable(ReplyMessage.class);

    @Override
    public ArrayList<ReplyMessage> replyMessageSelect(ReplyMessage conditions) throws SQLException, InterruptedException, IllegalAccessException, InstantiationException {
        return JdbcUtil.selectMax(TABLE, conditions);
    }

    @Override
    public int insertReplyMessage(ReplyMessage comfort) throws SQLException, InterruptedException, IllegalAccessException {
        return JdbcUtil.insert(TABLE, comfort);
    }

    @Override
    public int deleteReplyMessage(ReplyMessage conditions) throws SQLException, InterruptedException, IllegalAccessException {
        return JdbcUtil.delete(TABLE, conditions);
    }

    @Override
    public int updateReplyMessage(ReplyMessage set, ReplyMessage conditions) throws SQLException, InterruptedException, IllegalAccessException {
        return JdbcUtil.update(TABLE, set, conditions);
    }
}
